<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>val(val)-Form</title>
<meta name="keywords" content="jQuery 1.2 API Reference,Visual jQuery 1.2,jQuery doc,jQuery API,jQuery,jQuery 1.2 API 参考文档中文版,中文版" />
<meta name="description" content="jQuery 1.2 API 文档中文版，提供最新版 jQuery 开发帮助。" />
<link rel="stylesheet" type="text/css" href="../../style/jqueryapi.css" />
<script type="text/javascript" src="../../style/lib/jquery126.js"></script>
 </script>
<script type="text/javascript" src="../../style/jqueryapi.js"></script>
<link rel="shortcut icon" href="../../style/img/favicon.ico" />
</head>
<body>
<div id="topnav">
		<a href="http://www.jQuery.com/" title="jQuery官网" target="_blank" class="topnav">jQuery官网</a>
	<span class="topnav">|</span>
	<a href="http://jquery.org.cn/" title="jQuery中文网站" target="_blank" class="topnav">jQuery中文网站</a>
	<span class="topnav">|</span>
	<a href="http://www.cn-cuckoo.com/" title="1.1版译者" target="_blank" class="topnav">为之漫笔</a>
	<span class="topnav">|</span>
	<a href="http://shawphy.com/" title="1.2版翻译整理者" target="_blank" class="topnav">Shawphy</a>
    <span class="topnav">|</span>
	<a href="http://www.51toria.cn" title="CHM文档制作者:一揪" target="_blank" class="topnav">CHM文档制作者</a> 
	<span class="topnav">|</span>
	<a href="http://dl.getdropbox.com/u/81097/jQueryAPI_CHM.CHM" title="" target="_blank" class="topnav">CHM最新版本下载</a> 
</div>
<hr style="color:#595959;" />

<div class="content">
				<h1>val(val)</h1>
				<div class="desc">check,select,radio等都能使用为之赋值</div>
				<h2>返回值</h2>
				<p class="indent">jQuery</p>
				<h2>参数</h2>
				<p class="indent"><strong>val </strong>(Array&lt;String&gt;) : 用于 check/select 的值</p>
				<h2>示例</h2>
				<p class="indent">
					设定一个select和一个多选的select的值
				</p>
				<p class="indent"><strong>HTML 代码:</strong></p>
				<div class="code">
					&lt;select id="single"&gt;<br/>
&nbsp; &lt;option&gt;Single&lt;/option&gt;<br/>
&nbsp; &lt;option&gt;Single2&lt;/option&gt;<br/>
&lt;/select&gt;<br/>
&lt;select id="multiple" multiple="multiple"&gt;<br/>
&nbsp; &lt;option selected="selected"&gt;Multiple&lt;/option&gt;<br/>
&nbsp; &lt;option&gt;Multiple2&lt;/option&gt;<br/>
&nbsp; &lt;option selected="selected"&gt;Multiple3&lt;/option&gt;<br/>
&lt;/select&gt;&lt;br/&gt;<br/>
&lt;input type="checkbox" value="check1"/&gt; check1<br/>
&lt;input type="checkbox" value="check2"/&gt; check2<br/>
&lt;input type="radio" value="radio1"/&gt; radio1<br/>
&lt;input type="radio" value="radio2"/&gt; radio2 
				</div>
				<p class="indent"><strong>jQuery 代码:</strong></p>
				<div class="code">
					$("#single").val("Single2");<br/>
$("#multiple").val(["Multiple2", "Multiple3"]);<br/>
$("input").val(["check2", "radio1"]);<br/>
				</div>
			</div>
		</div>
            
</body>
</html>
